<?php
/* @var $this DistributionGiftNumberController */
/* @var $model DistributionGiftNumber */
/* @var $form CActiveForm */
$user_id = $_GET['user_id'];
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'distribution-gift-number-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note"><?php echo Yii::t('base','Fields with <span class="required">*</span> are required.');?></p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'partners_id'); ?>
		<?php echo $form->dropDownList($model,'partners_id',DistributionGiftNumber::model()->getPartnersName(''), array('options' => array($user_id=>array('selected'=>true)))); ?>
		<?php echo $form->error($model,'partners_id'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'number'); ?>
		<?php echo $form->textField($model,'number'); ?>
		<?php echo $form->error($model,'number'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'provide_time'); ?>
		 <input class="Wdate" type="text" name="DistributionGiftNumber[provide_time]" 
	 value="<?php echo $model->provide_time=='0000-00-00'?date("Y-m-d"):$model->provide_time;?>" onClick="WdatePicker({startDate:'%y-%M-01',dateFmt:'yyyy-MM-dd',alwaysUseStartDate:true})" />
		<?php echo $form->error($model,'provide_time'); ?>
	</div>
	
	<div class="row">
		<?php echo $form->labelEx($model,'backup1'); ?>
		<?php echo $form->textArea($model,'backup1',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'backup1'); ?>
	</div>
	
	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? Yii::t('base','Create') : Yii::t('base','Save')); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->